package com.example.demo2;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/cal")
@RestController
public class Calcontroller {
    @RequestMapping("/sum")
    public String sum(Integer num1, Integer num2) {
        if(num1==null||num2==null){
            return "参数错误，请重新输入";
        }else {
            Integer sum = num1+num2;
            return "两数相加"+sum;
        }
    }
}
